<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_core.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_37b66dfbfdffce01c33ebea49c49c2c3.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_core.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__core_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef __B_CORE_H__</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define __B_CORE_H__ </span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__config_8h.html">b_config.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structb_core_dev_table__t.html">   56</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;{</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structb_core_dev_table__t.html#a858e2685fb0034acadcd8d48cf6f02b2">   58</a></span>&#160;    uint8_t <a class="code" href="structb_core_dev_table__t.html#a858e2685fb0034acadcd8d48cf6f02b2">dev_no</a>;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structb_core_dev_table__t.html#abfa8a0ef7b1321866a7c4099554fdfb0">   59</a></span>&#160;    uint8_t name[8];</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;}<a class="code" href="structb_core_dev_table__t.html">bCoreDevTable_t</a>;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="structb_core_fd__t.html">   63</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;{</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="structb_core_fd__t.html#af57eaec6f3dec6de717735725c9908a6">   65</a></span>&#160;    uint8_t <a class="code" href="structb_core_fd__t.html#af57eaec6f3dec6de717735725c9908a6">number</a>;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="structb_core_fd__t.html#aff31312fb16705aa73c53b945a1a6b30">   66</a></span>&#160;    uint8_t <a class="code" href="structb_core_fd__t.html#aff31312fb16705aa73c53b945a1a6b30">flag</a>;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="structb_core_fd__t.html#ade818037fd6c985038ff29656089758d">   67</a></span>&#160;    uint8_t <a class="code" href="structb_core_fd__t.html#ade818037fd6c985038ff29656089758d">status</a>;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="structb_core_fd__t.html#a60011f40d336b1e91389c402d349fcc6">   68</a></span>&#160;    uint32_t <a class="code" href="structb_core_fd__t.html#a60011f40d336b1e91389c402d349fcc6">lseek</a>;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;}<a class="code" href="structb_core_fd__t.html">bCoreFd_t</a>;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___defines.html#ga9632edfe3a6652c254922f0fc6e4315c">   80</a></span>&#160;<span class="preprocessor">#define BCORE_FLAG_R            0</span></div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___defines.html#ga5e134ab3ebc11db6d585cfc1a48aadf0">   81</a></span>&#160;<span class="preprocessor">#define BCORE_FLAG_W            1</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___defines.html#ga0198147efa03609c64760662bd8ea00c">   82</a></span>&#160;<span class="preprocessor">#define BCORE_FLAG_RW           2</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___defines.html#ga925f6e907905a6bb8722167d2557474d">   84</a></span>&#160;<span class="preprocessor">#define BCORE_STA_NULL          0</span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___defines.html#gacc7e4aa393f80aff9c3dbf5d974c8698">   85</a></span>&#160;<span class="preprocessor">#define BCORE_STA_OPEN          1</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___defines.html#ga940e3dead286914001d8cb4606edc023">   87</a></span>&#160;<span class="preprocessor">#define BCORE_FD_MAX            10</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor">#ifndef NULL</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#define NULL    ((void *)0)</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="group___c_o_r_e___exported___macros.html#gac13b338bc1723e394a7d9743e31d23ea">  100</a></span>&#160;<span class="preprocessor">#define IS_VALID_FLAG(n)        (n == BCORE_FLAG_R || n == BCORE_FLAG_W || n == BCORE_FLAG_RW) </span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#ga249e47165f733672eae3653fcca87829">bOpen</a>(uint8_t dev_no, uint8_t flag);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#ga19ddb6f8ca523b3b28b74ea6a1519e3b">bRead</a>(<span class="keywordtype">int</span> fd, uint8_t *pdata, uint16_t len);</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#ga078b200cdc68be6d562cc1ad323d9381">bWrite</a>(<span class="keywordtype">int</span> fd, uint8_t *pdata, uint16_t len);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#gaf0a95eb51c436b56de56cdc63f5dab7c">bCtl</a>(<span class="keywordtype">int</span> fd, uint8_t cmd, <span class="keywordtype">void</span> *param);</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#gad49412624e7b58f0b90ff43e60823eb1">bLseek</a>(<span class="keywordtype">int</span> fd, uint32_t off);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#ga2d5143bd4493f8069401bb433939de4f">bClose</a>(<span class="keywordtype">int</span> fd);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___c_o_r_e___exported___functions.html#ga2579ab6e79fad3d62796972ab85a14f0">bCoreIsIdle</a>(<span class="keywordtype">void</span>); </div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    }</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160; </div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="ttc" id="structb_core_fd__t_html_ade818037fd6c985038ff29656089758d"><div class="ttname"><a href="structb_core_fd__t.html#ade818037fd6c985038ff29656089758d">bCoreFd_t::status</a></div><div class="ttdeci">uint8_t status</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00067">b_core.h:67</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_gaf0a95eb51c436b56de56cdc63f5dab7c"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#gaf0a95eb51c436b56de56cdc63f5dab7c">bCtl</a></div><div class="ttdeci">int bCtl(int fd, uint8_t cmd, void *param)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00254">b_core.c:254</a></div></div>
<div class="ttc" id="structb_core_fd__t_html_aff31312fb16705aa73c53b945a1a6b30"><div class="ttname"><a href="structb_core_fd__t.html#aff31312fb16705aa73c53b945a1a6b30">bCoreFd_t::flag</a></div><div class="ttdeci">uint8_t flag</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00066">b_core.h:66</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga2579ab6e79fad3d62796972ab85a14f0"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga2579ab6e79fad3d62796972ab85a14f0">bCoreIsIdle</a></div><div class="ttdeci">int bCoreIsIdle(void)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00281">b_core.c:281</a></div></div>
<div class="ttc" id="structb_core_fd__t_html_af57eaec6f3dec6de717735725c9908a6"><div class="ttname"><a href="structb_core_fd__t.html#af57eaec6f3dec6de717735725c9908a6">bCoreFd_t::number</a></div><div class="ttdeci">uint8_t number</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00065">b_core.h:65</a></div></div>
<div class="ttc" id="structb_core_fd__t_html_a60011f40d336b1e91389c402d349fcc6"><div class="ttname"><a href="structb_core_fd__t.html#a60011f40d336b1e91389c402d349fcc6">bCoreFd_t::lseek</a></div><div class="ttdeci">uint32_t lseek</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00068">b_core.h:68</a></div></div>
<div class="ttc" id="structb_core_dev_table__t_html"><div class="ttname"><a href="structb_core_dev_table__t.html">bCoreDevTable_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00056">b_core.h:56</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga078b200cdc68be6d562cc1ad323d9381"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga078b200cdc68be6d562cc1ad323d9381">bWrite</a></div><div class="ttdeci">int bWrite(int fd, uint8_t *pdata, uint16_t len)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00218">b_core.c:218</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga249e47165f733672eae3653fcca87829"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga249e47165f733672eae3653fcca87829">bOpen</a></div><div class="ttdeci">int bOpen(uint8_t dev_no, uint8_t flag)</div><div class="ttdoc">Open a device. </div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00175">b_core.c:175</a></div></div>
<div class="ttc" id="structb_core_dev_table__t_html_a858e2685fb0034acadcd8d48cf6f02b2"><div class="ttname"><a href="structb_core_dev_table__t.html#a858e2685fb0034acadcd8d48cf6f02b2">bCoreDevTable_t::dev_no</a></div><div class="ttdeci">uint8_t dev_no</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00058">b_core.h:58</a></div></div>
<div class="ttc" id="b__config_8h_html"><div class="ttname"><a href="b__config_8h.html">b_config.h</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_gad49412624e7b58f0b90ff43e60823eb1"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#gad49412624e7b58f0b90ff43e60823eb1">bLseek</a></div><div class="ttdeci">int bLseek(int fd, uint32_t off)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00239">b_core.c:239</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga19ddb6f8ca523b3b28b74ea6a1519e3b"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga19ddb6f8ca523b3b28b74ea6a1519e3b">bRead</a></div><div class="ttdeci">int bRead(int fd, uint8_t *pdata, uint16_t len)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00196">b_core.c:196</a></div></div>
<div class="ttc" id="structb_core_fd__t_html"><div class="ttname"><a href="structb_core_fd__t.html">bCoreFd_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00063">b_core.h:63</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga2d5143bd4493f8069401bb433939de4f"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga2d5143bd4493f8069401bb433939de4f">bClose</a></div><div class="ttdeci">int bClose(int fd)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00265">b_core.c:265</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
